package com.cyd.service;

import com.cyd.spring.*;

/**
 * @version 1.0.0
 * Created by cyd on 2024-07-31 10:18:28
 * @ClassName : com.cyd.service.UserService
 * @Description : 类描述
 */
@Component
@Scope(BeanScope.SINGLETON)
public class UserService implements BeanNameAware, InitializeBean, IUserService {

    @Autowired
    private OrderService orderService;

    private String beanName;

    private User admin;

    @Override
    public User getAdmin() {
        return admin;
    }


    @Override
    public void setBeanName(String beanName) {
        this.beanName = beanName;
    }

    @Override
    public void afterPropertiesSet() {
        //
        System.out.println("UserService do afterPropertiesSet");
    }

    @Override
    public void test() {
        System.out.println("UserService do proxy something");
        System.out.println(orderService);

    }

    @PostConstruct
    public void initAdmin() {
        User amdin = new User();
        amdin.setUserName("cyd");
        amdin.setUserPassword("123456");
        this.admin = amdin;
    }
}
